package ecweb.dao;

import java.util.List;

import ecweb.dal.DatabaseSession;
import ecweb.domain.GoodItem;
import ecweb.domain.GoodState;
import ecweb.exception.DatabaseException;
import util.lang.sql.SqlOrderByType;

public interface IGoodDao {

	GoodItem getGoodById(DatabaseSession dbses, long id)
			throws DatabaseException;
	
	List<GoodItem> getGoods(DatabaseSession dbses,
			String keyword,
			GoodState stateFilter,
			SqlOrderByType orderByPrice,
			SqlOrderByType orderByInventory,
			long limitStart, long limitLength)
					throws DatabaseException;
	
	long getGoodsCount(DatabaseSession dbses,
			String keyword,
			GoodState stateFilter)
					throws DatabaseException;
	
	boolean updateGoodById(DatabaseSession dbses, GoodItem good)
			throws DatabaseException;
	
	void addGood(DatabaseSession dbses, GoodItem good)
			throws DatabaseException;
	
	boolean deleteGoodById(DatabaseSession dbses, long id)
			throws DatabaseException;
}
